<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://xmlns.jcp.org/jsf/core">
    <h:head>
        <title>Search for a User</title>
    </h:head>
    <h:body>
        <p:layout fullPage="true">
            <p:layoutUnit position="north" size="100" style="border: 0px">
                <h:panelGrid columns="3" style="width: 100%">
                    <h:graphicImage value="/images/Simbolo_Meteocal.png" height="100"></h:graphicImage>
                    <h1>Welcome back</h1>
                    <h:button outcome="index" value="Create a new Event" />
                </h:panelGrid>
            </p:layoutUnit> 
            <p:layoutUnit position="center">
                    <h1>Search</h1>
                    <h:form>
                        <p:inputText id="inputsearch" value="#{searchBean.search}"/>
                        <p:commandButton id="goSearch" value="Start the search!" action="#{searchBean.lookForTheInput}">
                            <f:ajax execute="inputsearch" render="name1"/>
                            <f:ajax execute="inputsearch" render="surname1"/>
                            <f:ajax execute="inputsearch" render="email1"/>
                            <f:ajax execute="inputsearch" render="name1"/>
                            <f:ajax execute="inputsearch" render="name2"/>
                            <f:ajax execute="inputsearch" render="surname2"/>
                            <f:ajax execute="inputsearch" render="email2"/>
                            <f:ajax execute="inputsearch" render="name3"/>
                            <f:ajax execute="inputsearch" render="surname3"/>
                            <f:ajax execute="inputsearch" render="email3"/>
                            <f:ajax execute="inputsearch" render="name4"/>
                            <f:ajax execute="inputsearch" render="surname4"/>
                            <f:ajax execute="inputsearch" render="email4"/>
                            <f:ajax execute="inputsearch" render="name5"/>
                            <f:ajax execute="inputsearch" render="surname5"/>
                            <f:ajax execute="inputsearch" render="email5"/>
                        </p:commandButton>
                    </h:form>
                    <br/><h1>Contacts</h1><br/>
                <hr/>
                <h:panelGrid columns="2" style="width: 100%">
                        <h:outputLabel value="#{searchBean.name1(0)}" id="name1"/>
                        <h:outputLabel value="#{searchBean.surname1(0)}" id="surname1"/>
                        <h:outputLabel value="#{searchBean.email1(0)}" id="email1"/>
                        <form>
                            <h:commandButton id="comm1" value="View his/herCalendar"/>
                        </form>
                </h:panelGrid>
                <hr/>
                <h:panelGrid columns="2" style="width: 100%">
                        <h:outputLabel value="#{searchBean.name1(1)}" id="name2"/>
                        <h:outputLabel value="#{searchBean.surname1(1)}" id="surname2"/>
                        <h:outputLabel value="#{searchBean.email1(1)}" id="email2"/>
                        <form>
                            <h:commandButton id="comm2" value="View his/herCalendar"/>
                        </form>
                </h:panelGrid>
                <hr/>
                <h:panelGrid columns="2" style="width: 100%">
                        <h:outputLabel value="#{searchBean.name1(2)}" id="name3"/>
                        <h:outputLabel value="#{searchBean.surname1(2)}" id="surname3"/>
                        <h:outputLabel value="#{searchBean.email1(2)}" id="email3"/>
                        <form>
                            <h:commandButton id="comm3" value="View his/herCalendar"/>
                        </form>
                </h:panelGrid>
                <hr/>
                <h:panelGrid columns="2" style="width: 100%">
                        <h:outputLabel value="#{searchBean.name1(3)}" id="name4"/>
                        <h:outputLabel value="#{searchBean.surname1(3)}" id="surname4"/>
                        <h:outputLabel value="#{searchBean.email1(3)}" id="email4"/>
                        <form>
                            <h:commandButton id="comm4" value="View his/herCalendar"/>
                        </form>
                </h:panelGrid>
                <hr/>
                <h:panelGrid columns="2" style="width: 100%">
                        <h:outputLabel value="#{searchBean.name1(4)}" id="name5"/>
                        <h:outputLabel value="#{searchBean.surname1(4)}" id="surname5"/>
                        <h:outputLabel value="#{searchBean.email1(4)}" id="email5"/>
                        <form>
                            <h:commandButton id="comm5" value="View his/herCalendar"/>
                        </form>
                </h:panelGrid>
                <hr/>
                <h:panelGrid columns="2" style="width: 100%">
                    <h:form>
                        <h:commandButton id = "prev" value="Previous five" action="#{searchBean.prev}">
                            <f:ajax render="name1"/>
                            <f:ajax render="surname1"/>
                            <f:ajax render="email1"/>
                            <f:ajax render="name1"/>
                            <f:ajax render="name2"/>
                            <f:ajax render="surname2"/>
                            <f:ajax render="email2"/>
                            <f:ajax render="name3"/>
                            <f:ajax render="surname3"/>
                            <f:ajax render="email3"/>
                            <f:ajax render="name4"/>
                            <f:ajax render="surname4"/>
                            <f:ajax render="email4"/>
                            <f:ajax render="name5"/>
                            <f:ajax render="surname5"/>
                            <f:ajax render="email5"/>
                        </h:commandButton>
                        <h:commandButton id = "next" value="Next five" action="#{searchBean.next}">
                            <f:ajax render="name1"/>
                            <f:ajax render="surname1"/>
                            <f:ajax render="email1"/>
                            <f:ajax render="name1"/>
                            <f:ajax render="name2"/>
                            <f:ajax render="surname2"/>
                            <f:ajax render="email2"/>
                            <f:ajax render="name3"/>
                            <f:ajax render="surname3"/>
                            <f:ajax render="email3"/>
                            <f:ajax render="name4"/>
                            <f:ajax render="surname4"/>
                            <f:ajax render="email4"/>
                            <f:ajax render="name5"/>
                            <f:ajax render="surname5"/>
                            <f:ajax render="email5"/>
                        </h:commandButton>
                    </h:form>
                </h:panelGrid>
            </p:layoutUnit>
            <p:layoutUnit position="west" size="400">
                Today's event
               
            </p:layoutUnit>
            <p:layoutUnit position="south" size="60">
                <h:panelGrid columns="3" style="width: 100%">
                    <h:button outcome="homepage" value="Move back to your page" />
                    
                    <h:button outcome="notifications" value="Move to your notifications page" />
                    
                    <h:button outcome="index" value="Logout" />
                </h:panelGrid>
            </p:layoutUnit>
        </p:layout>
    </h:body>
</html>


